<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="/static/js/axios-0.18.0.min.js"></script>
{#      <script type="text/javascript">#}
{#        let url = 'http://127.0.0.1:8000/test2/';#}
{#        axios.get(url)#}
{#            .then(function(response){#}
{#                alert(response.data.message)#}
{#            })#}
{#            .catch(function(error){#}
{#                alert(error.response.data.message)#}
{#            })#}
{#    </script>#}
</head>
<body>
     <script type="text/javascript">
        let url = 'http://127.0.0.1:8000/test2/';
        axios.post(url)
            .then(function(response){
                alert(response.data.message)
            })
            .catch(function(error){
                alert(error.response.data.message)
            })
    </script>

</body>
</html>